package com.xuzimian.globaldemo.spring.springmvc.model;

import com.fasterxml.jackson.annotation.JsonView;

/**
 * @program: global-demo
 * @description:
 * @author: xzm
 * @create: 2019-04-24 15:25
 **/
public class User {
    /**
     * 不显示字段接口
     */
    public interface WithOutFieldView { } ;

    /**
     * 显示字段接口
     */
    public interface WithFieldView extends WithOutFieldView {} ; //继承


    private String name;
    private Integer age;
    private String password;

    public User() {
    }

    public User(String name, Integer age, String password) {
        this.name = name;
        this.age = age;
        this.password = password;
    }

    @JsonView(WithFieldView.class)
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    @JsonView(WithOutFieldView.class)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    @JsonView(WithOutFieldView.class)
    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }



}
